package com.lagou.service;

import com.lagou.dao.StudentInfoDao;
import com.lagou.entity.Student;

import java.util.List;

public class StudentInfoService {
    public static Student query(String keyword) {
        return StudentInfoDao.query(keyword);
    }

    public static List<Student> queryAll() {
        return StudentInfoDao.queryAll();
    }


//    public static int add(Student stu) { return StudentInfoDao.add(stu);}

    public static int update(Student stu) {

        if (stu.getId() < 1)
            return StudentInfoDao.add(stu);
        else
            return StudentInfoDao.edit(stu);

    }

    public static int delete(int id) {
        return StudentInfoDao.delete(id);
    }

}
